﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kovan.Model.Entity.Config;
using Kovan.Model.Parameter.Config;
using Kovan.DAL.Config;

namespace Kovan.BLL.Config
{
    public class BAd
    {
        DAd dal = new DAd();

        #region 当前类的实例
        private static readonly BAd Instances = new BAd();

        private BAd() { }

        public static BAd GetInstances()
        {
            return Instances;
        }
        #endregion

        /// <summary>
        /// 获取列表数据
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public IEnumerable<tb_ad> GetList(PAd param)
        {
            return dal.GetList(param);
        }

        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public tb_ad GetModel(long id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(tb_ad model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Delete(long id)
        {
            return dal.Delete(id);
        }

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int BatchDelete(IEnumerable<string> ids,out List<string> files)
        {
            return dal.BatchDelete(ids,out files);
        }



        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Update(tb_ad model)
        {
            return dal.Update(model);
        }
    }
}
